package com.cjt.springworkflow.controller;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class HelloWorld {
	
	@RequestMapping("/helloworld")
	public @ResponseBody String helloWorld(HttpServletRequest request,
			HttpServletResponse response){
		String from = (String)request.getAttribute("from");
		if(from != null){
			return "hello world! --来自"+from;
		}
		return "hello world! --来自Controller";
	}

}
